package com.xy.smartsms.helper;

import android.os.Handler;
import android.view.View;

/**
 * Created by admin on 2017/8/28 0028.
 */

public class SmartSmsCardOptions {
    private final int simpleBubbleId;
    private final int richBubbleId;
    private final int contentId;
    private final boolean featureOn;
    private final View rootView;
    private final View parentView;
    private final Callback callback;
    private final Handler handler;

    private SmartSmsCardOptions(Builder builder) {
        this.simpleBubbleId = builder.simpleBubbleId;
        this.richBubbleId = builder.richBubbleId;
        this.contentId = builder.contentId;
        this.featureOn = builder.featureOn;
        this.rootView = builder.rootView;
        this.parentView = builder.parentView;
        this.callback = builder.callback;
        this.handler = builder.handler;
    }

    public int getSimpleBubbleId() {
        return simpleBubbleId;
    }

    public int getRichBubbleId() {
        return richBubbleId;
    }

    public int getContentId() {
        return contentId;
    }

    public boolean isFeatureOn() {
        return featureOn;
    }

    public View getRootView() {
        return rootView;
    }

    public View getParentView() {
        return parentView;
    }

    public Handler getHandler() {
        return handler;
    }

    public Callback getCallback() {
        return callback;
    }

    public interface Callback {
        void showDefaultItem(boolean hasBubble);
    }

    public static class Builder {
        private int simpleBubbleId;
        private int richBubbleId;
        private int contentId;
        private boolean featureOn;
        private View rootView;
        private View parentView;
        private Callback callback;
        private Handler handler;

        public Builder() {
            this.featureOn = false;
            this.handler = null;
        }

        public Builder setSimpleBubbleId(int simpleBubbleId) {
            this.simpleBubbleId = simpleBubbleId;
            return this;
        }

        public Builder setRichBubbleId(int richBubbleId) {
            this.richBubbleId = richBubbleId;
            return this;
        }

        public Builder setContentId(int contentId) {
            this.contentId = contentId;
            return this;
        }

        public Builder setFeatureOn(boolean featureOn) {
            this.featureOn = featureOn;
            return this;
        }

        public Builder setHandler(Handler handler) {
            this.handler = handler;
            return this;
        }

        public Builder setRootView(View rootView) {
            this.rootView = rootView;
            return this;
        }

        public Builder setParentView(View parentView) {
            this.parentView = parentView;
            return this;
        }

        public Builder setCallback(Callback callback) {
            this.callback = callback;
            return this;
        }

        public SmartSmsCardOptions build() {
            return new SmartSmsCardOptions(this);
        }
    }
}
